#pragma once

using namespace System;
using namespace System::Collections::Generic;
using namespace System::IO;
using namespace System::Runtime::InteropServices;
using namespace System::Diagnostics;
using namespace CoreRay;

namespace CoreRay
{
	namespace DirectX
	{
		ref class DirectXGeometryObject
		{
		private:

			ID3D10Device* graphicsDevice;
		
			ID3D10Buffer* CreateVertexBuffer(array<byte>^ initialData, int elementSize);
			ID3D10Buffer* CreateIndexBuffer(array<byte>^ initialData);
			ID3D10InputLayout* CreateInputLayout(VertexFormat^ vertexFormat, ID3D10Effect* shader);
			D3D10_INPUT_ELEMENT_DESC* GetInputElementDescription(VertexFormat^ vertexFormat);
			DXGI_FORMAT ConvertVertexFormat(int size);

		public:
			
			property ID3D10Buffer* VertexBuffer;
			property ID3D10Buffer* IndexBuffer;
			property ID3D10InputLayout* InputLayout;
			property VertexFormat^ ObjectVertexFormat;
			property Matrix^ WorldMatrix;
			property Matrix^ InverseWorldMatrix;
			property int VertexCount;

			DirectXGeometryObject(ID3D10Device* graphicsDevice, ID3D10Effect* shader, Mesh^ Mesh);
			~DirectXGeometryObject();
			!DirectXGeometryObject();
		};
	}
}